<div id="basicListing">
<h1><span id="printThis"><%= link_to_function(image_tag("print.png",:border => 0), "javascript:print()") %></span> <%=h @event.title %></h1>
<table>
    <tr><td align="right" width="20%">Client:</td><td align="left"><%=h @event.client %></td></tr>
    <tr><td align="right">Description:</td><td align="left"><%=h @event.description %></td></tr>
    <tr><td align="right">Ticket #:</td><td align="left"><%=h @event.ticketNumber %></td></tr>
    <tr><td align="right">Total Time:</td><td align="left"><%= pluralize(@event.totalTime,"min") %></td></tr>
    <tr><td align="right">Reports:</td><td align="left"><%= link_to image_tag( "reports.png", :border => 0 ), :action => :byevent, :controller => :reports, :params => {:event_id => @event.id} %></td>
</table>
  <div id="taskEventDiv">
    <table>
      <tr>
      <th align="left"><font color="red">Tasks</font></th>
      <th align="left" width="100">Priority</th>
      <th align="left" width="100">Category</th>
      <th align="right" width="50"></td>
      </tr>
      <% for task in @event.tasks %>
        <tr>
          <td>
            <span class="<%= getTaskPriority(task) %>">
            <%= link_to task.description, task_path(task) %>
            </span>
          </td>
          <td align="left" width="100"><%= task.priority %></td>
          <td align="left" width="100"><% if task.category.nil? %> <% else %> <%= image_tag(task.category.imageFile, :border => 0) %><% end %></td>
          <td align="right" width="50" class="linkIcons"><%= link_to image_tag( "edit.png", :border => 0 ), edit_task_path(task) %> <%= link_to image_tag( "trash.png", :border => 0 ), task, :confirm => 'Are you sure?', :method => :delete %></td>
        </tr>
      <% end %>
    </table>
</div>

<table>
    <tr><td align="center" colspan="2"><br><u>Traces</u> <%= link_to image_tag( "clock.png", :border => 0 ), new_trace_path(:event_id => @event.id) %></td></tr>
    <tr><td align="left" colspan="2"><%= will_paginate @traces %></td></tr>
    <% @traces.each do |t| %>
      <tr>
        <td align="left" width="40%"><%= pluralize(t.minSpent, "min") %> (<%= t.created_at.strftime("%H:%M %b %d %Y") %>)</td>
        <td align="left" width="60%"><%= t.description %></td>
      </tr>
    <% end %>
</table>

<%= link_to 'Edit', edit_event_path(@event) %> |
<%= link_to 'Back', :controller => :home, :action => :index %>
</div>
